package com.jd.myaaaccount.util;

import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTimeHelper {
	public static String getCurrentTime() {
		return formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
	}

	public static String getCurrentTime(String format) {
		return formatDate(new Date(), format);
	}

	@SuppressLint("SimpleDateFormat")
	public static String formatDate(Date date, String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		return sdf.format(date);
	}
}
